<?php
class Dmf_View extends Dmf_Resource
{    
    /**
     * Return the full url
     * 
     * @param string $url
     * @return string
     */
    public function url( $url )
    {
        return $this->_config->application->public_path . $url;
    }
    
    /**
     * Render another file
     * 
     * @param string $file 
     */
    public function renderFile( $file )
    {
        if ( strstr( dirname( dirname( $this->_filename ) ), 'views' ) )
        {
            $resource = new Dmf_View( dirname( dirname( $this->_filename ) ) . '/' . $file );
        }
        else
        {
            $resource = new Dmf_View( dirname( dirname( $this->_filename ) ) . '/views/' . $file );
        }
        
        $resource->setMemory( $this->getMemory() );
        $resource->render();
    }
}